<template>
	<view class="mt20 pd">
		<view class="kxczxcstreszxr pd pt30 pm20">
			<view class="fz32 display-flex pr">
				<view class="flex-1">
					<text class="kkxczxerwt">实名信息</text>
				</view>
			</view>
			<view class="btm mt20 pt20">
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr">
						姓名:
					</view>
					<view class="z3">
						{{ret.realName||'--'}}
					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr">
						身份证:
					</view>
					<view class="z3">
						{{ret.idCard||'--'}}
					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr">
						手机号:
					</view>
					<view class="z3">
						{{ret.mobile||'--'}}
					</view>
				</view>
			</view>
			<view class="tr btm pt20 mt10" v-if="!ret.isAuthentication">
				<button  type="primary" size="mini" @tap="hfer('realNameAuthentication')">去实名</button>
			</view>
		</view>


		<view class="kxczxcstreszxr pd pt30 pm20 mt20">
			<view class="fz32 display-flex pr">
				<view class="flex-1">
					<text class="kkxczxerwt">发薪卡</text>
				</view>
			</view>
			<view class="btm mt20 pt20">
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr">
						发薪卡名:
					</view>
					<view class="z3">
						{{ret.payCardName||'--'}}
					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr">
						所属支行:
					</view>
					<view class="z3">
					{{ret.payCardBranch||'--'}}
					</view>
				</view>

				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr">
						发薪卡号:
					</view>
					<view class="z3">
						{{ret.payCard||'--'}}
					</view>
				</view>


			</view>
			<view class="tr btm pt20 mt10" >
				<button type="primary" size="mini" @tap="hfer('/pages/userCenter/addpayCard')">
					{{ret.payCard?'去修改':'去填写'}}
					
					</button>
			</view>
		</view>


		<view class="kxczxcstreszxr pd pt30 pm20 mt20">
			<view class="fz32 display-flex pr">
				<view class="flex-1">
					<text class="kkxczxerwt">其他</text>
				</view>
			</view>
			<view class="btm mt20 pt20">
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr vertical-center tl">
						微信:
					</view>
					<view class="z3 flex-1">
						<input v-model="ret.username" type="text" class="kxcxzrtrtxr pl20" placeholder="请输入微信号码" />
					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr vertical-center tl">
						QQ号:
					</view>
					<view class="z3 flex-1">
						<input v-model="ret.qqNo" type="text" class="kxcxzrtrtxr pl20" placeholder="请输入QQ号" />
					</view>
				</view>

				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr ab vertical-center tl">
						紧急联系人姓名:
					</view>
					<view class="z3 flex-1">
						<input v-model="ret.urgencyName" type="text" class="kxcxzrtrtxr pl20" placeholder="请输入紧急联系人姓名" />
					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr ab vertical-center tl">
						紧急联系人电话:
					</view>
					<view class="z3 flex-1">
						<input v-model="ret.urgencyPhone" type="number" class="kxcxzrtrtxr pl20" placeholder="请输入紧急联系人电话" />
					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					<view class="xczvrytxctrtr  vertical-center tl">
						与其关系:
					</view>
					<view class="z3 flex-1">
						<radio-group @change="radioChange" class="">
							<label class="xzczxctrt mr20" v-for="(item, index) in items" :key="item.dictValue">
								<view class="display-flex">
									<view>
										<radio 
										:value="item.dictValue" 
										class="kcxzvxcdrytr" 
										:checked="ret.urgencyRelation === item.dictValue" />
									</view>
									<view class="fz28 fgfdgdfgbty">{{item.dictLabel}}</view>
								</view>
							</label>

						</radio-group>


					</view>
				</view>
				<view class="pt10 pm10 display-flex fz30 z6">
					入职资料照片:
				</view>
				<view class="xcxzcsgfgfdgr mt20">
					<view class="czxcsderexcr vertical-center pr" @tap="kxmcfdf">
						<text class="iconfont icon-14CIRCLE clofdfdtrtrt" @tap.stop="jjmxdsfsd" v-if="ret.jobImg"> </text>
						<image :src="ret.jobImg" class="w100 h100 cz" mode="aspectFill" v-if="ret.jobImg"></image>
						<text class="iconfont icon-zhaopian xzcertrxcr" v-if="!ret.jobImg"></text>
					</view>
				</view>

			</view>
			<view class="tr btm pt20 mt20">
				<button type="primary" size="mini" @tap="bjhxdfrtx">保存</button>
			</view>
		</view>
	</view>
</template>
<script lang="ts" setup>
	import { ref } from "vue"
	import { hf, hfer, hfsan, dxrequest, VerifyTheLogin, upImg, yzphone,zidianall } from "@/util/index.js"
	import {onLoad} from "@dcloudio/uni-app"
	const current = ref()
	const jdfdsrt = ref([])
	const ret = ref({})
	const items = ref([])
	onLoad(async()=>{
		const relationshipWith = await zidianall("relationship_with")
		items.value = relationshipWith
	})
	const radioChange = (data) => {
		ret.value.urgencyRelation = data.detail.value
		
	}

	const kxmcfdf = async () => {
		const dhsd = await upImg()
		ret.value.jobImg = dhsd.imgurl
	}
	const jjmxdsfsd = (idx) => {
		ret.value.jobImg = ""
	}


	const getuser = async () => {
		const openid = uni.getStorageSync("openid")
		const { data } = await dxrequest("/api/user/" + openid)
		ret.value = data

	}
	getuser()
	const bjhxdfrtx = async()=>{
		const ksjd = await dxrequest("/api/user",ret.value,"put")
		if(ksjd.code==0){
			uni.showToast({
				title:"保存成功!"
			})
		}
	}
</script>

<style scoped>

</style>